function  getUrlParms(name)  {    
    var  reg  =  new  RegExp("(^|&)"  +  name  +  "=([^&]*)(&|$)");    
    var  r  =  window.location.search.substr(1).match(reg);    
    if  (r  !=  null)  return  r[2]; 
    return  null;
}
var  nameOne  =  getUrlParms("productid");

let  productid  =  decodeURI(nameOne)
console.log(productid);

function fn() {
    $.ajax({
            url: `http://chst.vip:1234/api/getmoneyctrlproduct?productid=${productid}`,

        }).then(res => {
            console.log(res) //请求到数据



            let html = "";
            res.result.forEach(item => { //遍历请求到的数据,item指每一项
                html += `
           
                <a class="info">
                    <div class="title">
                        <h4>${item.productName}</h4>
                    </div>
                    <div class="other">
                        <span>${item.productFrom} | ${item.productTime}</span>
                        <span>${item.productTips}</span>
                    </div>
                    <div class="container">
                        <p>
                             ${item.productImgSm} ${item.productInfo2}

                        </p>
                    </div>
                    <div class="bigimg">
                        ${item.productImg2}
                    </div>
                    <div class="city">
                        <ul> ${item.productCity}
                        </ul>
                    
                    
                    </div>
                </a>`





            })
            product.innerHTML = html;




            let as = document.querySelectorAll('.back a');
            [...as].forEach(a => {
                a.onclick = function() {
                    location.href = "../pages/moneyctrl.html"

                }
            })


            return res; //返回获取的数据
        })
        .then(res => {
            let empty = "";
            res.result.forEach(item => {
                empty += `
                
                ${item.productComment}
                
                


        `
            })
            comment.innerHTML = empty
        })
}
fn()